NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); View hView = navigationView.getHeaderView(0); TextView nav_user = (TextView) hView.findViewById(R.id.nav_name); nav_user.setText(user);